package com.rong.tools.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 周厚荣
 * @date 2025/4/26 11:10
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Value("${project.folder:}")
    private String projectFolder;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/images/**")
                .addResourceLocations("file:"+projectFolder); // 你保存图片的本地路径
    }
}
